package mysql

import "gorm.io/gorm"

type Cart struct {
	gorm.Model
	GoodsId int     `gorm:"type:int;not null;comment:商品编号"`
	Name    string  `gorm:"type:varchar(20);not null;comment:名称"`
	Num     int     `gorm:"type:int;not null;comment:数量"`
	Price   float64 `gorm:"type:float(10,2);not null;comment:价格"`
	Select  int     `gorm:"type:int;not null;comment:选中"`
	Status  int     `gorm:"type:int;not null;comment:状态"`
}

func (c *Cart) AddCart() error {
	return db.Create(&c).Error
}
